Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax grpc-js version constraint in fabric-shim #437

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

bestbeforetoday
Copy link
Member

@bestbeforetoday bestbeforetoday commented Sep 26, 2024

When different versions of @grpc/grpc-js are resolved in the dependency tree, the following error in the chaincode can prevent the chaincode container from starting:

TypeError: Channel credentials must be a ChannelCredentials object

This is typically caused by a mismatch between the versions of @grpc/grpc-js specified by fabric-shim and @hyperledger/fabric-protos. Provided the version constraints are loose enough to allow a single version to satisfy both dependencies, the mismatch can be avoided by deduping dependencies in a consuming chaincode.

This change relaxes the @grpc/grpc-js version constraint in fabric-shim to allow compatibility with any newer minor release version specified by @hyperledger/fabric-protos.

Closes #408

@bestbeforetoday bestbeforetoday force-pushed the grpc-version branch 3 times, most recently from fb20564 to e36f0db Compare September 26, 2024 22:56
When different versions of @grpc/grpc-js are resolved in the dependency
tree, the following error in the chaincode can prevent the chaincode
container from starting:

    TypeError: Channel credentials must be a ChannelCredentials object

This is typically caused by a mismatch between the versions of
@grpc/grpc-js specified by fabric-shim and @hyperledger/fabric-protos.
Provided the version constraints are loose enough to allow a single
version to satisfy both dependencies, the mismatch can be avoided by
deduping dependencies in a consuming chaincode.

This change relaxes the @grpc/grpc-js version constraint in fabric-shim
to allow compatibility with any newer minor release version specified by
@hyperledger/fabric-protos.

Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
@bestbeforetoday bestbeforetoday marked this pull request as ready for review September 26, 2024 23:35
@bestbeforetoday bestbeforetoday requested a review from a team as a code owner September 26, 2024 23:35
@bestbeforetoday bestbeforetoday enabled auto-merge (squash) September 26, 2024 23:35
return mapped;
});

speObject.rule.signedBy = spe.getRule().getSignedBy();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is the only actual change in this file. The rest is just formatting.

It seems newer binding defaulted the value of speObject.rule.signedBy to undefined instead of 0 when created by spe.toObject() in the test code above. This change just explicitly copies the actual value instead of relying on a default, and is probably how it should always have been done.

Note that this is just a change to how the test code collects the protobuf state before the equality test below. No change to the implementation code.

@bestbeforetoday bestbeforetoday merged commit e36d81e into hyperledger:main Sep 27, 2024
7 checks passed
@bestbeforetoday bestbeforetoday deleted the grpc-version branch September 27, 2024 16:35
Copy link
Contributor

@denyeart denyeart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Mark, looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError on chaincode start with fabric-shim >=2.5.1
2 participants